package com.qf.service.impl;

import com.github.pagehelper.PageHelper;
import com.qf.mapper.RouteMapper;
import com.qf.pojo.Route;
import com.qf.service.RouteService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 作者：冯国清
 * 项目名：com.qf.service.impl
 * 时间：2020/7/31 9:49
 * 描述:
 */
@Service
public class RouteServiceImpl implements RouteService {
    @Resource
    private RouteMapper routeMapper;
    @Override
    public List<Route> getAllCoute(int page, int limit) {
        PageHelper.startPage(page,limit);
        return routeMapper.getAllRoute();
    }

    @Override
    public int getCount() {
        return routeMapper.getCount();
    }

    @Override
    public int saveCoute(Route coute) {
        return routeMapper.saveRoute(coute);
    }

    @Override
    public Route selectCouteById(int rid) {
        return routeMapper.selectRouteById(rid);
    }

    @Override
    public int updateCoute(Route coute) {
        return routeMapper.updateRoute(coute);
    }

    @Override
    public int deleteCoute(int rid) {
        return routeMapper.deleteRoute(rid);
    }

    @Override
    public int deleteByIds(int[] rids) {
        return routeMapper.deleteByIds(rids);
    }
}
